<!DOCTYPE html>
<html lang="en">
	<head>
    	<meta name="layout" content="main_pc">
        <title>火堆工作台</title>       
        <link rel="stylesheet" href="${resource(dir: 'css', file: 'user.center.css')}" type="text/css">
        <script type="text/javascript" src="${resource(dir: 'js', file: 'jquery-1.10.2.js')}"></script>
	    <script type="text/javascript" src="${resource(dir: 'js', file: 'ajaxfileupload.js')}"></script>
	    <script src="${resource(dir: 'js', file: 'bootstrap-datepicker.min.js')}" charset="UTF-8"></script>
	    <link rel="stylesheet" href="${resource(dir: 'css_pc', file: 'bootstrap-datepicker.css')}" type="text/css">
    <style>
    
    
    .fix-width{
    width:280px;
    height:40px;
    float:left;
    margin-left:20px;
    }
    .btn-container-div{
    width:580px;
    height:40px;
    
    margin-left:20px;
    display:block;
    }
    
    .btn-container{
    float:left;
    width:80px;
    height:48px;
    }
    .data-list-box{
    margin-top:50px;
    }
    
    .link-download-all{
    padding: 6px 12px;
    margin-bottom: 0;
    font-size: 14px;
    font-weight: normal;
    line-height: 1.428571429;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    cursor: pointer;
    border: 1px solid transparent;
    border-radius: 4px;
    -webkit-user-select: none;
    }
    
    </style>
    </head>
<body>

	<div class="container-fluid">

		<section class="quick-navi mb20">
			<div class="container">
				<a href="#" class="quick-link"><span>火堆工作台</span><span
					class="caret"></span></a>
				<!--a href="#" class="quick-link">联系我们</a-->
			</div>
		</section>
		<section>
			<div class="container mb50">			
				<g:render template="navigate"   model="[status: status]"/>
				<div class="right-content" id="rightconsole">  
			<g:form id = "all-form" url="[resource:diaryInstance, action:'donateReportByDate']" method="post" class="form-style3">
		 	<div class="form-item fix-width">
	            <label for="">起始时间<span class="tips"></span></label>
	            <div class="form-tips"></div>
	            <div class="form-ctrl">
	            	<input type="text" class="datepicker" id="datePicker1" name="beginDate" value="${beginDate}">
	            </div>
	        </div>
	        <div class="form-item fix-width">
	            <label for="">截止时间<span class="tips"></span></label>
	            <div class="form-tips"></div>
	            <div class="form-ctrl">
	            	<input type="text" class="datepicker" id="datePicker2" name="endDate" value="${endDate}">
	            </div>
	        </div>
	        
		  <div class="btn-container-div">
		   <div class="btn-container">
	            <Button class="btn btn-save-all">查询</Button>
	        </div>
	        <div class="btn-container"><%--
	         <Button class="btn btn-save-all" id="btn-download">下载</Button>
	           --%><g:link controller="manage" action="downDonateReportByDate" params='[beginDate:"${beginDate}",endDate:"${endDate}",exportType:"excel",extension:"xls"]' target='_blank'><div class="btn btn-download-all" data-dialog="dialog1">下载</div></g:link>
	        </div>
		  
		  </div>
	       
	   
    </g:form>
               
                    <div class="data-list-box">                        
                        <ul class="cdsp-table">
                            <li class="t-head">
                               <div class="col-1"></div>
                                <div class="col-2">捐赠编号</div>
                                <div class="col-2">捐赠总金额</div>
                                <div class="col-2">捐赠金额</div>
                                <div class="col-2">平台管理费</div>
								<div class="col-3">是否包含平台管理费</div>
								<div class="col-2">捐赠支付状态</div>
								<div class="col-2">捐赠时间</div>
								
                                <div class="clearboth"></div>
                            </li>
                             
                            <g:each in="${donates}" var="${donate}" status="i">
                            	<li>
                            		<div class="col-1">
                                     <div class="title">${i+1}</div>
                                 </div>
                                  <div class="col-2">
                                     <div class="title">${donate.donateNoNew}</div>
                                 </div>
                                 <div class="col-2">
                                     <div class="text">${donate.money} 元</div>
                                 </div>
                                 <div class="col-2">
                                     <div class="text">${donate.donate_fee/100} 元</div>
                                 </div>
                                 <div class="col-2">
                                     <div class="text">${donate.operate_fee/100} 元</div>
                                 </div>
                                 <div class="col-4">
                                     <div class="text">${donate.operate_fee_status}</div>
                                 </div>
                                 <div class="col-2">
                                     <div class="text">${donate.status}</div>
                                 </div>
                                 <div class="col-4">
                                     <div class="text">
                                     <g:formatDate format="yyyy-MM-dd" date="${donate.date}"/>
                                     </div>
                                 </div>
                                 <div class="clearboth"></div>
                            	</li>
                            </g:each>
                        </ul>
                    </div>
                    
                    <div class="pagea">
	                <span>共${totalCount ?: 0}条记录</span>
	                <div class="page float_r">
						<g:paginate controller="manage" action="donateReportByDate" total="${totalCount ?: 0}"  params="${params}" />
					</div>
            		</div>		            	                            
               	</div>
				
				
					
                	
			</div>
			<div class="clearboth"></div>
		</section>


	</div>

<!-- 删除弹出框 -->


	<script type="text/javascript">
	$(function(){
    	$('.meterial-lib-box .content-box .form-box .img-box input[type=file]').change(function(){
            $(this).siblings('.img-default').hide().parent().css('background-image', 'url(' + getFileURL(this) + ')');
        });
    	$('.date-picker').datepicker({
            language: 'zh-CN',
            autoclose: true,
            todayHighlight: true
        })


        
    	$('#datePicker1').datepicker({
		    format: "yyyy-mm-dd"
		});
    	$('#datePicker2').datepicker({
		    format: "yyyy-mm-dd"
		});

    	$('.btn-save-all').click(function(){
     		this.html('search...');
     		this.click(function(){});
    	    	 var data = editor.getValue();
    	    	 $("#articleDetail").val(data);
    	    	 //console.log(data);
    	         $("#all-form").submit();
    	         
    	    });
    	$('#btn-download').click(function(){
     		this.html('download...');
     		this.click(function(){});
    			 //if(!checkNull()){
    			 	//return;
    			//}
    			//save context
    			 //var channel = $("")
    	    	 var data = editor.getValue();
    	    	 $("#articleDetail").val(data);
    	    	 //console.log(data);
    	    	 var src='/manage/downDonateReportByDate?beginDate=';
    	    	 src+=$("#datePicker1").val();
    	    	 src+='&endDate=';
    	    	 src+=$("#datePicker2").val();
    	    	 src+='&exportType=excel&extension=xls';
        	    	 
    	    		alert(src);
    	    		window.local.href=src;
    	    	
    	         
    	    });
    	
		
    });

	
    
	</script>

</body>
</html>